package cfh.spring.mvc.controller;

import cfh.spring.mvc.model.Coffee;
import cfh.spring.mvc.service.CoffeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 咖啡 控制器
 *
 * @author chenfh
 * date 2019/7/30
 */
@RestController
@RequestMapping("/coffee")
public class CoffeeController {

    @Autowired
    private CoffeeService coffeeService;

    @GetMapping("/")
    public List<Coffee> getAll() {
        return coffeeService.getAllCoffee();
    }

}
